package me.nereo.multi_image_selector;

import android.app.Activity;
import android.support.v4.app.Fragment;

/**
 * Created by Martin on 2017/1/17.
 */
public class SMultiImageSelector {
  private static MultiImageConfig multiImageConfig;
  private Fragment fragment;
  private Activity activity;

  private SMultiImageSelector(Fragment fragment) {
    this.fragment = fragment;
  }

  private SMultiImageSelector(Activity activity) {
    this.activity = activity;
  }

  public static SMultiImageSelector from(Fragment fragment) {
    return new SMultiImageSelector(fragment);
  }

  public static SMultiImageSelector from(Activity activity) {
    return new SMultiImageSelector(activity);
  }

  public static void init(MultiImageConfig config) {
    multiImageConfig = config;
  }

  public static MultiImageConfig getMultiImageConfig() {
    if (multiImageConfig == null) {
      throw new IllegalArgumentException("you must call init() first");
    }
    return multiImageConfig;
  }
}
